//
//  UtilMacro.h
//  JFmerchant
//
//  Created by 文彬 on 2018/1/12.
//  Copyright © 2018年 文彬. All rights reserved.
//

#ifndef UtilMacro_h
#define UtilMacro_h

#import "AppDelegate.h"

#define ApplicationDelegate ((AppDelegate *)[UIApplication sharedApplication].delegate)
#define UserDefaults [NSUserDefaults standardUserDefaults]
#define APPDataCenter [AppDataCenter sharedAppDataCenter]

//---------------------------------手机相关------------------
#define SCREEN_HEIGHT [UIScreen mainScreen ].bounds.size.height //屏幕高度
#define SCREEN_WIDTH  [UIScreen mainScreen ].bounds.size.width //屏幕宽度

#define isIphoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)


/** tabbar高度 */
#define kTabBarHeight ((NSInteger)SCREEN_HEIGHT == 812? 83 : 49)

/** 状态栏高度 */
#define kStatusBarHeight  ((NSInteger)SCREEN_HEIGHT == 812? 44 : 20)

/** 导航栏高度 */
#define kNavigationBarHeight  ((NSInteger)SCREEN_HEIGHT == 812 ? 88 : 64)

//---------------------------------颜色设置------------------
#define RGBCOLOR(r,g,b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1]
#define RGBACOLOR(r,g,b,a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)]
//rgb颜色转换（16进制->10进制）
#define HEXRGBCOLOR(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]

//---------------------------循环----------------
#define WeakObj(o)  __weak typeof(o) o##Weak = o;
#define StrongObj(o) __strong typeof(o) o = o##Weak;

//---------------------------block回调----------------
typedef void(^CompleteHandle)(id param);
typedef void(^CompleteMoreHandle)(id param,BOOL hasMore);
typedef void(^ErrHandle)(int errCode, id param);


#endif /* UtilMacro_h */
